<template>
  <div class="payment-result">
    <div class="header">
      <van-icon name="arrow-left" @click="goBack" />
      <span>支付结果</span>
    </div>
    <div class="content">
      <van-icon name="success-circle-o" size="64" color="#ee6666" />
      <h2>支付成功</h2>
      <p>您的订单已支付成功！</p>
    </div>
    <van-button type="primary" block @click="viewOrder">查看订单</van-button>
  </div>
</template>

<script setup>
import { ref } from 'vue';
// 返回上一页
const goBack = () => {
  // 这里可使用路由跳转回上一页，假设使用vue-router
  // 先引入router
  // import { useRouter } from 'vue-router';
  // const router = useRouter();
  // router.back();
  console.log('返回上一页');
};
// 查看订单
const viewOrder = () => {
  console.log('查看订单');
  // 这里可添加实际查看订单的逻辑，如跳转到订单详情页面等
};
</script>

<style scoped>
.payment-result {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: #fff;
}
.header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.content {
  text-align: center;
  margin-bottom: 32px;
}
</style>